/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package boxync;

import java.io.File;
import javax.swing.JDialog;

/**
 *
 * @author Edgar Drake
 */
public class Boxync extends javax.swing.JFrame {
    File repository;
    final String repoPath = "F:/Project/boxync";
    /**
     * Creates new form Boxync
     */
    public Boxync() {
        initComponents();
//        this.setLocationByPlatform(true);
        repository = new File(repoPath);
        showLoginForm();
    }
    
    public void showLoginForm() {
        if (loginForm == null) {
            loginForm = new LoginForm(this, false);
            loginForm.setLocationRelativeTo(this);
            loginForm.setBounds((414 - 235) / 2, (365 - 150) / 2, 235, 150);
        }
        loginForm.setVisible(true);
    }
    
    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        dirList = new javax.swing.JTable();
        title = new javax.swing.JLabel();
        dir = new javax.swing.JLabel();
        address = new javax.swing.JTextField();
        browse = new javax.swing.JButton();
        move = new javax.swing.JButton();
        delete = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Boxync");
        setPreferredSize(new java.awt.Dimension(414, 365));
        setResizable(false);
        getContentPane().setLayout(null);

        dirList.setFont(new java.awt.Font("Tahoma", 0, 10)); // NOI18N
        dirList.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null}
            },
            new String [] {
                "Filename/Folder", "Size", "Date"
            }
        ));
        dirList.setPreferredSize(new java.awt.Dimension(80, 64));
        jScrollPane1.setViewportView(dirList);

        getContentPane().add(jScrollPane1);
        jScrollPane1.setBounds(10, 80, 375, 190);

        title.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N
        title.setText("Boxync");
        getContentPane().add(title);
        title.setBounds(100, 10, 70, 30);

        dir.setText("Directory");
        getContentPane().add(dir);
        dir.setBounds(10, 50, 50, 20);

        address.setFont(new java.awt.Font("Tahoma", 0, 10)); // NOI18N
        getContentPane().add(address);
        address.setBounds(80, 50, 300, 19);

        browse.setIcon(new javax.swing.ImageIcon(getClass().getResource("/boxync/browse.png"))); // NOI18N
        browse.setToolTipText("Set up a new folder to be synced with Boxync's server");
        getContentPane().add(browse);
        browse.setBounds(170, 280, 50, 40);

        move.setIcon(new javax.swing.ImageIcon(getClass().getResource("/boxync/move.png"))); // NOI18N
        move.setToolTipText("Move working copy from old folder to a new folder");
        getContentPane().add(move);
        move.setBounds(290, 280, 50, 40);

        delete.setIcon(new javax.swing.ImageIcon(getClass().getResource("/boxync/copy.png"))); // NOI18N
        delete.setToolTipText("Delete the selected file. Only one file may applied one at a time");
        getContentPane().add(delete);
        delete.setBounds(50, 280, 50, 40);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /*
         * Set the Nimbus look and feel
         */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If Nimbus (introduced in Java SE 6) is not available, stay with the
         * default look and feel. For details see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Boxync.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Boxync.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Boxync.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Boxync.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /*
         * Create and display the form
         */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new Boxync().setVisible(true);
            }
        });
    }
    
    private JDialog loginForm;
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTextField address;
    private javax.swing.JButton browse;
    private javax.swing.JButton delete;
    private javax.swing.JLabel dir;
    private javax.swing.JTable dirList;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JButton move;
    private javax.swing.JLabel title;
    // End of variables declaration//GEN-END:variables
}
